//
//  coderTest.swift
//  SwiftTest
//
//  Created by appleTwo on 2019/3/11.
//  Copyright © 2019 QiKai. All rights reserved.
//
//序列化 反序列化

import UIKit

class coderTest: NSObject {
    var num:Int?
    var str:String?
    var arr:Array<Any>?
    
    func encodeWithCoder(aCoder:NSCoder!){
        aCoder.encode(self.num,forKey:"num")
        aCoder.encode(self.str,forKey:"str")
        aCoder.encode(self.arr,forKey:"arr")
    }
    init(coder aDecoder:NSCoder!){
        self.num = aDecoder.decodeInteger(forKey:"num")
        self.str = (aDecoder.decodeObject(forKey:"str") as! String)
        self.arr = (aDecoder.decodeObject(forKey:"arr") as! Array<Any>)
    }
    
}









